//
//  MBDeliverItemView.m
//  MemberBusiness-ios
//
//  Created by cherry pu on 2018/4/24.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import "MBDeliverItemView.h"

@implementation MBDeliverItemView

- (instancetype)initWithTitle:(NSString*)title andMessage:(NSString*)message
{
    self = [super init];
    if (self) {
        
        UILabel* titleLabel = [[UILabel alloc]init];
        titleLabel.text = title;
        titleLabel.font = [UIFont lf_systemFontOfSize:12];
        titleLabel.textColor = [UIColor colorWithR:24 G:24 B:24];
        titleLabel.textAlignment = NSTextAlignmentLeft;
        [self addSubview:titleLabel];
        
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self);
            make.left.equalTo(self).offset([UIView lf_sizeFromIphone6:12]);
            make.width.mas_equalTo([UIView lf_sizeFromIphone6:69]);
        }];

        UILabel* messageLabel = [[UILabel alloc]init];
        messageLabel.textAlignment = NSTextAlignmentLeft;
        messageLabel.text = message;
        self.messageLabel = messageLabel;
        messageLabel.font = [UIFont lf_systemFontOfSize:12];
        messageLabel.textColor = [UIColor colorWithR:24 G:24 B:24];
        messageLabel.numberOfLines = 0;
        [self addSubview:messageLabel];
        
        [messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self);
            make.right.equalTo(self).offset([UIView lf_sizeFromIphone6:-42]);
            make.left.equalTo(titleLabel.mas_right);
            make.bottom.equalTo(self);
        }];

    }
    return self;
}

@end
